#include    "InvocableUserCommand.h"        // alfs::InvocableUserCommand

// File [alfs/gui/InvocableUserCommand.cpp].
//
// InvocableUserCommand
//
// An InvocableUserCommand is a UserCommand with a binding to some internal program
// action.
//
// (c) copyright Alf P. Steinbach 2008.
// Use, modification and distribution are subject to the "New BSD License"
// as listed at <url: http://www.opensource.org/licenses/bsd-license.php>.


namespace alfs{

#   define  ThisClass   InvocableUserCommand

    void ThisClass::noAction()
    {}

    ThisClass::~ThisClass()
    {}

    ThisClass::ThisClass()
        : BaseClass(), myAction( &noAction )
    {}

    ThisClass::ThisClass( Id id, std::wstring const& defaultText, Action const& action )
        : BaseClass( id, defaultText )
        , myAction( action )
    {}

    ThisClass::ThisClass( std::wstring const& defaultText, Action const& action )
        : BaseClass( defaultText )
        , myAction( action )
    {}

    ThisClass::Action ThisClass::action() const
    {
        return myAction;
    }

    void ThisClass::execute() const
    {
        myAction();
    }

#   undef   ThisClass

}  // alfs
